// OGoMojo
// Whitemice.MOGI.IDocument
// License: LGPL
// Copyright: Whitemice Consulting, 2006
// Author(s): Adam Tauno Williams (awilliam@whitemice.org)
using System;
using System.Collections;

namespace Whitemice.MOGI {

	/// \brief an enumeration of possible document types
	public enum DocumentType :uint {
		Undefined = 0,
		Contact = 1,
		Enterprise = 2,
		Project = 3,
		Task = 4,
		Appointment = 5,
		Account = 6,
		Resource = 7,
		Team = 8,
		AuditEntry = 9,
		BLOB = 10
	}
	 
	/// \brief The interface supported by all server documents
	public interface IDocument : IMOGIObject {
		DocumentType Type { get; }
		int Version { get; }	
		object ExtendedAttribute(string attribute);
		void ExtendedAttribute(string attribute, object value);
		bool HasExtendedAttribute(string attribute);
		bool SupportsOperation(Operation operation);		
		ArrayList Rights { get; }
		bool Writable { get; }
		bool HasRead(string actorId);
		bool HasWrite(string actorId);
		bool HasRight(string actorId, string operation);
		void GrantRight(string actorId, bool write, bool read);
		void GrantRight(Rights right);
		void GrantRights(ArrayList rights);
		void GrantRights(Rights[] rights);
		event DocumentModifiedDelegate Modified;
		bool IsModified { get; }
		IServer	Server { get; }
	}
	
	/// \brief The interface supported by all owned server documents
	public interface IOwnedDocument : IDocument {
		string Owner { get; }
	}
}